package com.zmn.plat.services.impl.netcall;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zmn.manager.common.database.annotation.ReadOnlyConnection;
import com.zmn.plat.model.entity.netcall.UserImAccount;
import com.zmn.plat.persistence.interfaces.netcall.UserImAccountDao;
import com.zmn.plat.services.interfaces.netcall.UserImAccountService;

/**
 * @author sunlife
 * @since 2019/7/11 19:45
 */
@Service
public class UserImAccountServiceImpl implements UserImAccountService {

    @Resource
    UserImAccountDao userImAccountDao;

    @Override
    @ReadOnlyConnection
    public UserImAccount selectByStaffId(Integer staffId) {
        return userImAccountDao.selectByUid(staffId);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insert(UserImAccount userImAccount) {
        userImAccountDao.insert(userImAccount);
    }

    @Override
    public void updateToke(UserImAccount userImAccount) {
        userImAccountDao.updateToke(userImAccount);
    }

    @Override
    public void deletByUid(Integer staffId) {
        userImAccountDao.deletByUid(staffId);
    }
}
